package com.huatai.bi.config;//package com.huatai.bi.config;
//
//import com.alibaba.druid.pool.DruidDataSource;
//import lombok.Data;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.stereotype.Component;
//
//import javax.sql.DataSource;
//
///**
// * @BelongsProject: itc-airport-cloud
// * @BelongsPackage: com.huatai.bi.config
// * @Author: hecaiy
// * @CreateTime: 2024-06-29  14:37
// * @Description: TODO springboot 配置clickhouse数据源
// * @Version: 1.0
// */
//@Data
//@Component
//public class DruidClickHouseConfig {
//
//    @Autowired
//    private ConnectionClickHouseConfig connectionClickHouseConfig;
//
//    /**
//     * 构建clickhouse数据源
//     * @return
//     */
//    @Bean("getClickHouseDataSource")
//    public DataSource getClickHouseDataSource() {
//        DruidDataSource druidDataSource = new DruidDataSource();
//        druidDataSource.setDriverClassName(connectionClickHouseConfig.getDriverClassName());
//        druidDataSource.setUrl(connectionClickHouseConfig.getUrl());
//        druidDataSource.setUsername(connectionClickHouseConfig.getUsername());
//        druidDataSource.setPassword(connectionClickHouseConfig.getPassword());
//        druidDataSource.setInitialSize(connectionClickHouseConfig.getInitialSize());
//        druidDataSource.setMaxActive(connectionClickHouseConfig.getMaxActive());
//        druidDataSource.setMinIdle(connectionClickHouseConfig.getMinIdle());
//        druidDataSource.setMaxWait(connectionClickHouseConfig.getMaxWait());
//        return druidDataSource;
//    }
//}
